﻿<?php 
error_reporting(E_ERROR | E_PARSE);

include_once('../../includes/metodos.php');
include_once('../../includes/ini.php');
connectSql();
$sql = mysql_query("SELECT * FROM econ_usuarios WHERE id=".$_SESSION['id']);
while ($row = mysql_fetch_array($sql)) {
	$nome_cabecalho = $row['apelido'];
	$avatar = $row['avatar'];
	$permissao = $row['permissao'];
}
?>
<!doctype html>
<html lang="pt-br">
<head>
<title>Administrador</title>
<meta charset=�UTF-8�>
<link href="<?php echo EXTERNAL_ROOT_PORTAL;?>/admin/css/estilo2.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<?php echo EXTERNAL_ROOT_PORTAL;?>/admin/js/tiny_mce/tiny_mce.js"></script>
<link href="<?php echo EXTERNAL_ROOT_PORTAL;?>/img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<SCRIPT LANGUAGE="Javascript">
function decision(message, url){
	if(confirm(message)) location.href = url;
}
</SCRIPT>

<script type="text/javascript">
	tinyMCE.init({
		mode : "textareas",
		theme : "advanced",
		editor_deselector : "noTinyMce",
		plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true
	});
</script>
<!-- /TinyMCE -->

</head>
          <div style=";width:898px; height:80px; margin:0 auto;">
		     <h1 id="logonoticia"><a href="<?php echo EXTERNAL_ROOT_PORTAL;?>/admin/"><img src="<?php echo EXTERNAL_ROOT_PORTAL;?>/admin/img/logo_noticias.gif"></a></h1>
		     <div id="div_login">
		     <label id="msg_login">Ol&aacute;, <?php echo $nome_cabecalho;?></label>
		     	<?php 
		     		if(!empty($avatar)){
		     			echo '<img src="'.EXTERNAL_ROOT_PORTAL.'/admin/perfil/'.$avatar.'"/>';
		     		}else{
		     			echo '<img src="'.EXTERNAL_ROOT_PORTAL.'/admin/perfil/img/face_avatar.png"/>';
		     		}
		     	?>
		     <label id="msg_sair"><a href="<?php echo EXTERNAL_ROOT_PORTAL;?>/logof.php">Sair</a></label>
			 </div>
	      </div>
	<div id="conteudo_menu"> 
     <div id="menu">
       <div style="margin:0 auto;width:634px;">             
         <ul id="ul_menu_cabecalho">
            <?php if(!empty($_SESSION['id'])){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/perfil/index.php">perfil</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/noticias/index.php">not&iacute;cias</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/categoria/index.php">categoria</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/usuarios/index.php">usu&aacute;rio</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/multimidia/index.php">mult&iacute;midia</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/parceiros/index.php">parceiros</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/institucional/index.php">institucional</a></li>';}?>
            <?php if($permissao==1 || $permissao==2){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/colunista/index.php">colunistas</a></li>';}?>
            <?php if($permissao==1){ echo '<li id="li_bt_menu_noticia"><a href="'.EXTERNAL_ROOT_PORTAL.'/admin/glossario/index.php">gloss&aacute;rio</a></li>';}?>
         </ul>
       </div>
      </div>
	</div>